package com.mxx.common.security;

import com.mxx.common.security.displacer.Base64Displacer;

/**
 * @author: mxx
 * @date: 2022/4/2
 * @time: 13:48
 * @Description: 描述信息
 */
public class Test {

    public static void main(String[] args) {
        KeyGenerator generator = new KeyGenerator(Base64Displacer.BASE64);
        String text = "123456";
        String iv = generator.getAesIV();

        String key = generator.getKey();
        DesCipher desCipher = DesCipher.cbc(key, iv)
                .padding(Constant.CipherPadding.PKCS7);

        System.out.println(DESPkcs7Util.decode(text, key, iv));
        System.out.println(desCipher.encryptToStr(text).get());

        System.out.println(desCipher.encryptToStr(text).get());


    }
}
